From: Giovanni Campagna Date: Tue, 8 Oct 2013 19:23:30 +0000 (+0200) Subject: NetworkMenu: fix wireless-enabled property notifications X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~3269 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=8a8b3bf96e22c1da35fc9bb6203d3d40c08653ac;p=gnome-shell.git NetworkMenu: fix wireless-enabled property notifications The property is on the NMClient, not NMDevice. Also, make sure we disconnect the signal when the item is destroyed. Also, connect to wireless-hardware-enabled, which we'll use soon. https://bugzilla.gnome.org/show_bug.cgi?id=709635 --- diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 6a2efc9a0..26aa81616 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -971,7 +971,8 @@ const NMDeviceWireless = new Lang.Class({ this.item.menu.addSettingsAction(_("Network Settings"), 'gnome-network-panel.desktop'); - this._wirelessEnabledChangedId = this._device.connect('notify::wireless-enabled', Lang.bind(this, this._sync)); + this._wirelessEnabledChangedId = this._client.connect('notify::wireless-enabled', Lang.bind(this, this._sync)); + this._wirelessHwEnabledChangedId = this._client.connect('notify::wireless-hardware-enabled', Lang.bind(this, this._sync)); this._activeApChangedId = this._device.connect('notify::active-access-point', Lang.bind(this, this._activeApChanged)); this._stateChangedId = this._device.connect('state-changed', Lang.bind(this, this._deviceStateChanged)); @@ -991,6 +992,14 @@ const NMDeviceWireless = new Lang.Class({ this._activeAccessPoint.disconnect(this._strengthChangedId); this._strengthChangedId = 0; } + if (this._wirelessEnabledChangedId) { + this._client.disconnect(this._wirelessEnabledChangedId); + this._wirelessEnabledChangedId = 0; + } + if (this._wirelessHwEnabledChangedId) { + this._client.disconnect(this._wirelessHwEnabledChangedId); + this._wirelessHwEnabledChangedId = 0; + } this.item.destroy(); },